package suphero;

    public class triangle extends GeometricObject {
        private double bottom;
        private double height;
        private double side1;
        private double side2;
        public triangle(double bottom, double height,double side1,double side2) {
            this.bottom = bottom;
            this.height = height;
            this.side1 = side1;
            this.side2 = side2;
        }
        public double getBottom() {
            return bottom;
        }
        public void setBottom(double bottom) {
            this.bottom = bottom;
        }
        public double getHeight() {
            return height;
        }
        public void setHeight(double height) {
            this.height = height;
        }
        public double getSide1() {
            return side1;
        }
        public void setSide1(double side1) {
            this.side1 = side1;
        }
        public double getSide2() {
            return side2;
        }
        public void setSide2(double side2) {
            this.side2 = side2;
        }
        @Override /** Return area */
        public double getArea() {
            return bottom * height/2;
        }
        @Override /** Return perimeter */
        public double getPerimeter() {
            return (side1 + side2 + height);
        }

    }

